<template>
  <div class="profileCard">
    <div class="top" :style="{ backgroundImage: 'url(' + require('@/assets/img/profile_1.png') + ')' }">
      <div class="cardtop_content">
        <p class="user_name">{{ itemInfo.Publisher }}</p>
        <p class="user_id">ID：{{ itemInfo.Id }}</p>
        <ul class="tagList">
          <li v-for="(item, index) in splicType" :key="index">{{ item }}</li>
        </ul>
        <div class="flex num">
          <p>剧本：{{ itemInfo.ScriptWritingNum }}</p>
        </div>
      </div>
    </div>
    <div class="bottom">
      <div>
        <h3 class="title">{{ itemInfo.Title }}</h3>
        <p class="desc">{{ itemInfo.Description }}</p>
        <div class="flex num">
          <div class="flex">
            <i class="iconfont icon-shoucang"></i>
            <p>{{ itemInfo.CollectionNum }}</p>
          </div>
          <div class="flex">
            <i class="iconfont icon-thumb"></i>
            <p>{{ itemInfo.SupportNum }}</p>
          </div>
        </div>
      </div>
      <div class="flex border_top">
        <p>作品费用</p>
        <p class="price">￥{{ itemInfo.Price }}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    itemInfo: {
      type: Object,
    },
  },
  data() {},
  computed:{
     splicType(){
       return (this.itemInfo.ClassifyNames || '').split(',')
     }
  },
  mounted() {
    console.log(this.itemInfo.bg);
  },
};
</script>
<style lang="scss" scoped>
.flex {
  display: flex;
  align-items: center;
}
.profileCard {
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  .top {
    position: relative;
    height: 170px;
    background-size: cover;
    color: #fff;
    &::before {
      position: absolute;
      content: "";
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.3);
      z-index: 1;
    }
    .cardtop_content {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      position: relative;
      width: 100%;
      height: 100%;
      padding: 0 20px;
      z-index: 2;
      .user_name {
        font-size: 14px;
        margin-bottom: 10px;
      }
      .user_id {
        font-size: 12px;
        margin-bottom: 20px;
      }
      .tagList {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 10px;
        li {
          font-size: 10px;
          font-weight: 300;
          border: 1px solid #fff;
          margin-right: 7px;
          padding: 2px 5px;
          margin-bottom: 5px;
          &:last-child {
            margin-right: 0;
          }
        }
      }
      .num {
        font-size: 10px;
        p:first-child {
          margin-right: 30px;
        }
      }
    }
  }
  .bottom {
    background: #fff;
    & > div {
      padding: 15px 13px;
    }
    .title {
      font-size: 12px;
      margin-bottom: 12px;
    }
    .desc {
      font-size: 12px;
      color: #a3a3a3;
      margin-bottom: 20px;
    }
    .num {
      font-size: 12px;
      color: #a3a3a3;
      div:first-child {
        margin-right: 20px;
      }
    }
    .border_top {
      border-top: 1px solid #e9e9e9;
      justify-content: space-between;
      font-size: 10px;
      color: #666;
      .price {
        font-size: 16px;
        font-weight: bold;
        color: #fb3d4e;
      }
    }
  }
}
</style>
